package com.woniuxy.microsysserver.mapper;

import com.woniuxy.microsysserver.bean.DepartmentInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DepartmentMapper {

    @Select("select id,department_name as departmentName,department_des as departmentDes,create_time as createTime,state from department_info where id = #{id}")
    DepartmentInfo findById(Integer id);


    @Select("select id,department_name as departmentName,department_des as departmentDes,create_time as createTime from department_info where state = 1 ")
    @ResultType(value = List.class)
    List<DepartmentInfo> findAll();
}
